/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-04-04     lenovo       the first version
 */
#ifndef LIBRARIES_RT_DRIVERS_DRV_SPI_H_
#define LIBRARIES_RT_DRIVERS_DRV_SPI_H_


#include <rtthread.h>
#include <rtdevice.h>
#include <n32g45x.h>
#if 1
#ifdef __cplusplus
extern "C" {
#endif
#endif

struct n32_hw_spi_cs
{
    GPIO_Module* module;
    uint32_t pin;
};

rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, GPIO_Module *cs_gpiox, uint32_t cs_gpio_pin);

#if 1
#ifdef __cplusplus
}
#endif
#endif

#endif /* LIBRARIES_RT_DRIVERS_DRV_SPI_H_ */
